]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
cleanup: Use new indentation style for arrays
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 27 Mar 2020 13:18:34 +0000 (14:18 +0100)
committerMarge Bot <marge-bot@gnome.org>
Wed, 23 Feb 2022 12:23:52 +0000 (12:23 +0000)
We've made some progress on transitioning to the modern indentation
style, and for arrays the legacy style is now rare enough to make
a bulk transition feasible.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2200>

15 files changed:
js/gdm/loginDialog.js
js/perf/hwtest.js
js/ui/components/networkAgent.js
js/ui/components/telepathyClient.js
js/ui/ibusCandidatePopup.js
js/ui/magnifier.js
js/ui/messageList.js
js/ui/notificationDaemon.js
js/ui/remoteSearch.js
js/ui/sessionMode.js
js/ui/shellMountOperation.js
js/ui/status/keyboard.js
js/ui/status/network.js
js/ui/windowManager.js
lint/eslintrc-legacy.yml

index 4e2c948dc9565f7f4eb921f3c7e63ea3d4bb0ce7..f114e86eac306e1e7e356af3759d17e005b048f3 100644 (file)
@@ -1192,8 +1192,10 @@ var LoginDialog = GObject.registerClass({
 
         this._updateCancelButton();
 
-        let batch = new Batch.ConcurrentBatch(this, [GdmUtil.cloneAndFadeOutActor(this._userSelectionBox),
-                                                     this._beginVerificationForItem(activatedItem)]);
+        const batch = new Batch.ConcurrentBatch(this, [
+            GdmUtil.cloneAndFadeOutActor(this._userSelectionBox),
+            this._beginVerificationForItem(activatedItem),
+        ]);
         batch.run();
     }
 
index 0f396acd320a5e306b04d341f799dd86d1b5b2e5..8793ce8a9db5a91c3397ffed4c3ceb8c85389296 100644 (file)
@@ -73,12 +73,13 @@ function waitSignal(object, signal) {
 }
 
 function extractBootTimestamp() {
-    let sp = Gio.Subprocess.new(['journalctl', '-b',
-                                 'MESSAGE_ID=7d4958e842da4a758f6c1cdc7b36dcc5',
-                                 'UNIT=graphical.target',
-                                 '-o',
-                                 'json'],
-                                Gio.SubprocessFlags.STDOUT_PIPE);
+    const sp = Gio.Subprocess.new([
+        'journalctl', '-b',
+        'MESSAGE_ID=7d4958e842da4a758f6c1cdc7b36dcc5',
+        'UNIT=graphical.target',
+        '-o',
+        'json',
+    ], Gio.SubprocessFlags.STDOUT_PIPE);
     let result = null;
 
     let datastream = Gio.DataInputStream.new(sp.get_stdout_pipe());
index 1960ad1e739affc839f322aefeba11a3abe3ec35..82ed97890bafa55fc4770d1daa6e28bbf97993a2 100644 (file)
@@ -425,10 +425,12 @@ var VPNRequestHandler = class {
 
         let connectionSetting = connection.get_setting_connection();
 
-        let argv = [authHelper.fileName,
-                    '-u', connectionSetting.uuid,
-                    '-n', connectionSetting.id,
-                    '-s', serviceType];
+        const argv = [
+            authHelper.fileName,
+            '-u', connectionSetting.uuid,
+            '-n', connectionSetting.id,
+            '-s', serviceType,
+        ];
         if (authHelper.externalUIMode)
             argv.push('--external-ui-mode');
         if (flags & NM.SecretAgentGetSecretsFlags.ALLOW_INTERACTION)
index 335f32a9adb1d19dc30cbb36a54f88067a68ce57..e0719a465a8fb3dcdce49bd99f59980de24a4f35 100644 (file)
@@ -145,10 +145,12 @@ class TelepathyClient extends Tp.BaseClient {
         factory.add_account_features([Tp.Account.get_feature_quark_connection()]);
         factory.add_connection_features([Tp.Connection.get_feature_quark_contact_list()]);
         factory.add_channel_features([Tp.Channel.get_feature_quark_contacts()]);
-        factory.add_contact_features([Tp.ContactFeature.ALIAS,
-                                      Tp.ContactFeature.AVATAR_DATA,
-                                      Tp.ContactFeature.PRESENCE,
-                                      Tp.ContactFeature.SUBSCRIPTION_STATES]);
+        factory.add_contact_features([
+            Tp.ContactFeature.ALIAS,
+            Tp.ContactFeature.AVATAR_DATA,
+            Tp.ContactFeature.PRESENCE,
+            Tp.ContactFeature.SUBSCRIPTION_STATES,
+        ]);
 
         // Set up a SimpleObserver, which will call _observeChannels whenever a
         // channel matching its filters is detected.
index 5a9fe77928bee8f1edf1b5647dbc8fe9c97efac3..68c14b8bbec0102687455c1b7b31159ef897af50 100644 (file)
@@ -8,14 +8,18 @@ const Main = imports.ui.main;
 
 var MAX_CANDIDATES_PER_PAGE = 16;
 
-var DEFAULT_INDEX_LABELS = ['1', '2', '3', '4', '5', '6', '7', '8',
-                            '9', '0', 'a', 'b', 'c', 'd', 'e', 'f'];
+var DEFAULT_INDEX_LABELS = [
+    '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
+    'a', 'b', 'c', 'd', 'e', 'f',
+];
 
 var CandidateArea = GObject.registerClass({
     Signals: {
-        'candidate-clicked': { param_types: [GObject.TYPE_UINT,
-                                             GObject.TYPE_UINT,
-                                             Clutter.ModifierType.$gtype] },
+        'candidate-clicked': {
+            param_types: [
+                GObject.TYPE_UINT, GObject.TYPE_UINT, Clutter.ModifierType.$gtype,
+            ],
+        },
         'cursor-down': {},
         'cursor-up': {},
         'next-page': {},
index e68dc84f0e6f924e9a697d7a5a3b169ed672f769..da4c53f8e60ca69fdb57a02cbad95759e8e68025 100644 (file)
@@ -802,8 +802,10 @@ var ZoomRegion = class ZoomRegion {
         }
 
         let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
-        let [xFocus, yFocus] = [(extents.x + (extents.width / 2)) * scaleFactor,
-                                (extents.y + (extents.height / 2)) * scaleFactor];
+        const [xFocus, yFocus] = [
+            (extents.x + (extents.width / 2)) * scaleFactor,
+            (extents.y + (extents.height / 2)) * scaleFactor,
+        ];
 
         if (this._xFocus !== xFocus || this._yFocus !== yFocus) {
             [this._xFocus, this._yFocus] = [xFocus, yFocus];
@@ -997,9 +999,11 @@ var ZoomRegion = class ZoomRegion {
         let roiWidth = this._viewPortWidth / this._xMagFactor;
         let roiHeight = this._viewPortHeight / this._yMagFactor;
 
-        return [this._xCenter - roiWidth / 2,
-                this._yCenter - roiHeight / 2,
-                roiWidth, roiHeight];
+        return [
+            this._xCenter - roiWidth / 2,
+            this._yCenter - roiHeight / 2,
+            roiWidth, roiHeight,
+        ];
     }
 
     /**
@@ -1580,8 +1584,10 @@ var ZoomRegion = class ZoomRegion {
     _screenToViewPort(screenX, screenY) {
         // Converts coordinates relative to the (unmagnified) screen to coordinates
         // relative to the origin of this._magView
-        return [this._viewPortWidth / 2 + (screenX - this._xCenter) * this._xMagFactor,
-                this._viewPortHeight / 2 + (screenY - this._yCenter) * this._yMagFactor];
+        return [
+            this._viewPortWidth / 2 + (screenX - this._xCenter) * this._xMagFactor,
+            this._viewPortHeight / 2 + (screenY - this._yCenter) * this._yMagFactor,
+        ];
     }
 
     _updateMagViewGeometry() {
index 45ebbf53d0fe9eabb300ce619c12e355b568ef75..a8431ac54e5dc6ffe330f81fc29ce4a499193fb9 100644 (file)
@@ -192,16 +192,20 @@ class ScaleLayout extends Clutter.BinLayout {
         this._connectContainer(container);
 
         let [min, nat] = super.vfunc_get_preferred_width(container, forHeight);
-        return [Math.floor(min * container.scale_x),
-                Math.floor(nat * container.scale_x)];
+        return [
+            Math.floor(min * container.scale_x),
+            Math.floor(nat * container.scale_x),
+        ];
     }
 
     vfunc_get_preferred_height(container, forWidth) {
         this._connectContainer(container);
 
         let [min, nat] = super.vfunc_get_preferred_height(container, forWidth);
-        return [Math.floor(min * container.scale_y),
-                Math.floor(nat * container.scale_y)];
+        return [
+            Math.floor(min * container.scale_y),
+            Math.floor(nat * container.scale_y),
+        ];
     }
 });
 
@@ -275,10 +279,14 @@ var LabelExpanderLayout = GObject.registerClass({
 
         if (children[1]) {
             let [min2, nat2] = children[1].get_preferred_height(forWidth);
-            let [expMin, expNat] = [Math.min(min2, min * this._expandLines),
-                                    Math.min(nat2, nat * this._expandLines)];
-            [min, nat] = [min + this._expansion * (expMin - min),
-                          nat + this._expansion * (expNat - nat)];
+            const [expMin, expNat] = [
+                Math.min(min2, min * this._expandLines),
+                Math.min(nat2, nat * this._expandLines),
+            ];
+            [min, nat] = [
+                min + this._expansion * (expMin - min),
+                nat + this._expansion * (expNat - nat),
+            ];
         }
 
         return [min, nat];
index 4058ebdc390ad056d44983e6751c096e450e5cbe..bf886b1a697ac36b89c6d15ab5f2be90dc234715 100644 (file)
@@ -43,8 +43,10 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
 
     _imageForNotificationData(hints) {
         if (hints['image-data']) {
-            let [width, height, rowStride, hasAlpha,
-                 bitsPerSample, nChannels_, data] = hints['image-data'];
+            const [
+                width, height, rowStride, hasAlpha,
+                bitsPerSample, nChannels_, data,
+            ] = hints['image-data'];
             return Shell.util_create_pixbuf_from_data(data, GdkPixbuf.Colorspace.RGB, hasAlpha,
                                                       bitsPerSample, width, height, rowStride);
         } else if (hints['image-path']) {
@@ -195,9 +197,8 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
     }
 
     _notifyForSource(source, ndata) {
-        let [id_, icon, summary, body, actions, hints, notification] =
-            [ndata.id, ndata.icon, ndata.summary, ndata.body,
-             ndata.actions, ndata.hints, ndata.notification];
+        const { icon, summary, body, actions, hints } = ndata;
+        let { notification } = ndata;
 
         if (notification == null) {
             notification = new MessageTray.Notification(source);
index 368afc5dae950487aa6a8621356d25e1137b1c62..a31a17ff527d6c5de2fbff8dc49e16d0e827c60a 100644 (file)
@@ -221,8 +221,10 @@ var RemoteSearchProvider = class {
         } else if (meta['gicon']) {
             gicon = Gio.icon_new_for_string(meta['gicon']);
         } else if (meta['icon-data']) {
-            let [width, height, rowStride, hasAlpha,
-                 bitsPerSample, nChannels_, data] = meta['icon-data'];
+            const [
+                width, height, rowStride, hasAlpha,
+                bitsPerSample, nChannels_, data,
+            ] = meta['icon-data'];
             gicon = Shell.util_create_pixbuf_from_data(data, GdkPixbuf.Colorspace.RGB, hasAlpha,
                                                        bitsPerSample, width, height, rowStride);
         }
index 7d83ddb6be300cc33e94ff3e3d245ad79046ffc5..b8b627370d7c8000603745d7f5331bad287410c5 100644 (file)
@@ -11,6 +11,14 @@ const Config = imports.misc.config;
 
 const DEFAULT_MODE = 'restrictive';
 
+const USER_SESSION_COMPONENTS = [
+    'polkitAgent', 'telepathyClient', 'keyring',
+    'autorunManager', 'automountManager',
+];
+
+if (Config.HAVE_NETWORKMANAGER)
+    USER_SESSION_COMPONENTS.push('networkAgent');
+
 const _modes = {
     'restrictive': {
         parentMode: null,
@@ -82,12 +90,7 @@ const _modes = {
         isLocked: false,
         isPrimary: true,
         unlockDialog: imports.ui.unlockDialog.UnlockDialog,
-        components: Config.HAVE_NETWORKMANAGER
-            ? ['networkAgent', 'polkitAgent', 'telepathyClient',
-               'keyring', 'autorunManager', 'automountManager']
-            : ['polkitAgent', 'telepathyClient',
-               'keyring', 'autorunManager', 'automountManager'],
-
+        components: USER_SESSION_COMPONENTS,
         panel: {
             left: ['activities', 'appMenu'],
             center: ['dateMenu'],
index 0ef383d582453f57b3ac1e86ca45b5458e52ae4d..6e213cd62abbaf91b150ea35729600bcc0c5ff8d 100644 (file)
@@ -254,12 +254,18 @@ var ShellMountQuestionDialog = GObject.registerClass({
 });
 
 var ShellMountPasswordDialog = GObject.registerClass({
-    Signals: { 'response': { param_types: [GObject.TYPE_INT,
-                                           GObject.TYPE_STRING,
-                                           GObject.TYPE_BOOLEAN,
-                                           GObject.TYPE_BOOLEAN,
-                                           GObject.TYPE_BOOLEAN,
-                                           GObject.TYPE_UINT] } },
+    Signals: {
+        'response': {
+            param_types: [
+                GObject.TYPE_INT,
+                GObject.TYPE_STRING,
+                GObject.TYPE_BOOLEAN,
+                GObject.TYPE_BOOLEAN,
+                GObject.TYPE_BOOLEAN,
+                GObject.TYPE_UINT,
+            ],
+        },
+    },
 }, class ShellMountPasswordDialog extends ModalDialog.ModalDialog {
     _init(message, flags) {
         let strings = message.split('\n');
index 04663953231c2da66fd2a3ab617fe8280cffbdf8..c2b5cfd6ee5555777d031d0731ea25a602a80106 100644 (file)
@@ -795,16 +795,20 @@ class InputSourceIndicatorContainer extends St.Widget {
         // for those we don't actually display.
         return this.get_children().reduce((maxWidth, child) => {
             let width = child.get_preferred_width(forHeight);
-            return [Math.max(maxWidth[0], width[0]),
-                    Math.max(maxWidth[1], width[1])];
+            return [
+                Math.max(maxWidth[0], width[0]),
+                Math.max(maxWidth[1], width[1]),
+            ];
         }, [0, 0]);
     }
 
     vfunc_get_preferred_height(forWidth) {
         return this.get_children().reduce((maxHeight, child) => {
             let height = child.get_preferred_height(forWidth);
-            return [Math.max(maxHeight[0], height[0]),
-                    Math.max(maxHeight[1], height[1])];
+            return [
+                Math.max(maxHeight[0], height[0]),
+                Math.max(maxHeight[1], height[1]),
+            ];
         }, [0, 0]);
     }
 
index a90b29778ad223a6eff93067bdb10462d5f9145a..f06a8fe822ddeeacbd54df5dfd2d7cc7e1f2fca8 100644 (file)
@@ -1752,9 +1752,11 @@ class Indicator extends PanelMenu.SystemIndicator {
         this._nmDevices = [];
         this._devices = { };
 
-        let categories = [NMConnectionCategory.WIRED,
-                          NMConnectionCategory.WIRELESS,
-                          NMConnectionCategory.WWAN];
+        const categories = [
+            NMConnectionCategory.WIRED,
+            NMConnectionCategory.WIRELESS,
+            NMConnectionCategory.WWAN,
+        ];
         for (let category of categories) {
             this._devices[category] = new DeviceCategory(category);
             this.menu.addMenuItem(this._devices[category]);
index a4bbf75ad543eef49fa4f750f79f5ee8a46bc83e..0f56082303533ee2cd60e2def96f25a4ef27402e 100644 (file)
@@ -1135,9 +1135,11 @@ var WindowManager = class {
     }
 
     _minimizeWindow(shellwm, actor) {
-        let types = [Meta.WindowType.NORMAL,
-                     Meta.WindowType.MODAL_DIALOG,
-                     Meta.WindowType.DIALOG];
+        const types = [
+            Meta.WindowType.NORMAL,
+            Meta.WindowType.MODAL_DIALOG,
+            Meta.WindowType.DIALOG,
+        ];
         if (!this._shouldAnimateActor(actor, types)) {
             shellwm.completed_minimize(actor);
             return;
@@ -1200,9 +1202,11 @@ var WindowManager = class {
     }
 
     _unminimizeWindow(shellwm, actor) {
-        let types = [Meta.WindowType.NORMAL,
-                     Meta.WindowType.MODAL_DIALOG,
-                     Meta.WindowType.DIALOG];
+        const types = [
+            Meta.WindowType.NORMAL,
+            Meta.WindowType.MODAL_DIALOG,
+            Meta.WindowType.DIALOG,
+        ];
         if (!this._shouldAnimateActor(actor, types)) {
             shellwm.completed_unminimize(actor);
             return;
@@ -1467,9 +1471,11 @@ var WindowManager = class {
         if (actor.meta_window.is_attached_dialog())
             this._checkDimming(actor.get_meta_window().get_transient_for());
 
-        let types = [Meta.WindowType.NORMAL,
-                     Meta.WindowType.DIALOG,
-                     Meta.WindowType.MODAL_DIALOG];
+        const types = [
+            Meta.WindowType.NORMAL,
+            Meta.WindowType.DIALOG,
+            Meta.WindowType.MODAL_DIALOG,
+        ];
         if (!this._shouldAnimateActor(actor, types)) {
             shellwm.completed_map(actor);
             return;
@@ -1544,9 +1550,11 @@ var WindowManager = class {
         if (window.is_attached_dialog())
             this._checkDimming(window.get_transient_for());
 
-        let types = [Meta.WindowType.NORMAL,
-                     Meta.WindowType.DIALOG,
-                     Meta.WindowType.MODAL_DIALOG];
+        const types = [
+            Meta.WindowType.NORMAL,
+            Meta.WindowType.DIALOG,
+            Meta.WindowType.MODAL_DIALOG,
+        ];
         if (!this._shouldAnimateActor(actor, types)) {
             shellwm.completed_destroy(actor);
             return;
index e8a0e2935c884bef9164e779f9e1debd87cec44a..127166ef2c54b05b91310998d8f29bfeb0bba811 100644 (file)
@@ -7,7 +7,6 @@ rules:
       - 'CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > ClassExpression:first-child'
       CallExpression:
         arguments: first
-      ArrayExpression: first
       ObjectExpression: first
       MemberExpression: off
   jsdoc/check-alignment: off